package com.wanger.swa.domain.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.wanger.swc.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @Author: wanger
 * @Date: 2024/9/15 17:25
 * @Description: 模板
 */
@Data
@ApiModel("模板")
@TableName("sw_template")
@EqualsAndHashCode(callSuper = true)
public class TemplatePO extends BaseEntity {
    private static final long serialVersionUID = 3570468531089957616L;

    @ApiModelProperty("父id")
    private String pid;

    @ApiModelProperty("名称")
    private String name;

    @ApiModelProperty("内容")
    private String content;

    @ApiModelProperty("类型【wj:文件,ml:目录】")
    private String type;

    @ApiModelProperty("是否转换为zip的模板表达式")
    private String zip;

    @ApiModelProperty("是否跳过的模板表达式")
    private String skip;

    /**
     * 要展开的字段，默认为空，展开方式为循环遍历，会直接从当前数据对象中get出该字段，get到则展开，get不到则报模板异常，如下两种展开方式<br/>
     * 列表展开:
     * <pre>{@code
     * #foreach($user in $users)
     *     Name: ${user.name}
     * #end
     * }
     *
     * </pre>
     * map展开:
     * <pre>{@code
     * #foreach($user in $userMap.entrySet())
     *     <li>${user.id}: ${user.name}</li>
     * #end
     * }
     *
     * </pre>
     */
    @ApiModelProperty("要展开的字段")
    private String unfoldField;

    @ApiModelProperty("字段展开后的别名")
    private String unfoldFieldAlias;

    @ApiModelProperty("提示说明")
    private String reminder;

    @ApiModelProperty("默认父id")
    public static final String defaultPid = "root";

}
